<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Superpixel Benchmark: lib_eval/depth_tools.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Superpixel Benchmark
   </div>
   <div id="projectbrief">Superpixel benchmark, tools and algorithms.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_f07c7e2e21621c6454ef07b472f6f1ef.html">lib_eval</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">depth_tools.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="depth__tools_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#ifndef DEPTH_TOOLS_H</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#define DEPTH_TOOLS_H</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &lt;opencv2/opencv.hpp&gt;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="classDepthTools.html">   40</a></span>&#160;<span class="keyword">class </span><a class="code" href="classDepthTools.html">DepthTools</a> {</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html">   45</a></span>&#160;    <span class="keyword">struct </span><a class="code" href="structDepthTools_1_1Camera.html">Camera</a> {</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#a34b8f5bf9592942336b758dba2a975d5">projectZ</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> depth, <span class="keywordtype">float</span> factor = 1000.f) <span class="keyword">const</span>;</div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#adc6000905bf3ba8e79ea6fcfe6fd2c02">projectX</a>(T x, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> depth, <span class="keywordtype">float</span> factor = 1000.f) <span class="keyword">const</span>;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T&gt;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#af5126a2aac351482c1545e014f33baf6">projectY</a>(T y, <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> depth, <span class="keywordtype">float</span> factor = 1000.f) <span class="keyword">const</span>;</div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keywordtype">int</span> <a class="code" href="structDepthTools_1_1Camera.html#ac077b9fe4972ac558c4506193d9f117b">backprojectX</a>(<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> depth, <span class="keywordtype">float</span> factor = 1000.f) <span class="keyword">const</span>;</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;        <span class="keywordtype">int</span> <a class="code" href="structDepthTools_1_1Camera.html#a2aeff5c4a0ec9b294600e6f144dcb3c9">backprojectY</a>(<span class="keywordtype">float</span> y, <span class="keywordtype">float</span> depth, <span class="keywordtype">float</span> factor = 1000.f) <span class="keyword">const</span>;</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html#ac16b93a85e37c55024ef394eaf75391f">   94</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#ac16b93a85e37c55024ef394eaf75391f">cropping_x</a>;</div><div class="line"><a name="l00096"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html#aec87be561dad1ae254c8792ddf91731f">   96</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#aec87be561dad1ae254c8792ddf91731f">cropping_y</a>;</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html#ae92153e30078cf854dcc1fb18295a59e">   98</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#ae92153e30078cf854dcc1fb18295a59e">principal_x</a>;</div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html#adab192877142048d2ef887cb2a7f2e51">  100</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#adab192877142048d2ef887cb2a7f2e51">principal_y</a>;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html#a071885bfabfbfd5fa95108d6426c2d8e">  102</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#a071885bfabfbfd5fa95108d6426c2d8e">focal_x</a>;</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="structDepthTools_1_1Camera.html#adde5a323c881acc956535dffe0a491a7">  104</a></span>&#160;        <span class="keywordtype">float</span> <a class="code" href="structDepthTools_1_1Camera.html#adde5a323c881acc956535dffe0a491a7">focal_y</a>;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    };</div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    </div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;    <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classDepthTools.html#a4e6d9dd6e6befb91222f7e2b1b5a58fa">computeCloudFromDepth</a>(<span class="keyword">const</span> cv::Mat &amp;depth, <span class="keyword">const</span> <a class="code" href="structDepthTools_1_1Camera.html">Camera</a> &amp;camera,</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;            cv::Mat &amp;cloud);</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;};</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="preprocessor">#endif  </span><span class="comment">/* DEPTH_TOOLS_H */</span><span class="preprocessor"></span></div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;</div><div class="ttc" id="structDepthTools_1_1Camera_html_aec87be561dad1ae254c8792ddf91731f"><div class="ttname"><a href="structDepthTools_1_1Camera.html#aec87be561dad1ae254c8792ddf91731f">DepthTools::Camera::cropping_y</a></div><div class="ttdeci">float cropping_y</div><div class="ttdoc">If the images was cropped in y dimension by a specific number of pixels. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:96</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_adc6000905bf3ba8e79ea6fcfe6fd2c02"><div class="ttname"><a href="structDepthTools_1_1Camera.html#adc6000905bf3ba8e79ea6fcfe6fd2c02">DepthTools::Camera::projectX</a></div><div class="ttdeci">float projectX(T x, unsigned short depth, float factor=1000.f) const </div><div class="ttdoc">Given the depth by depth/factor, project the x coordinate into 3D room. </div><div class="ttdef"><b>Definition:</b> depth_tools.cpp:48</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_a2aeff5c4a0ec9b294600e6f144dcb3c9"><div class="ttname"><a href="structDepthTools_1_1Camera.html#a2aeff5c4a0ec9b294600e6f144dcb3c9">DepthTools::Camera::backprojectY</a></div><div class="ttdeci">int backprojectY(float y, float depth, float factor=1000.f) const </div><div class="ttdoc">Given the depth by depth/factor, back project the y coordinate to image plain. </div><div class="ttdef"><b>Definition:</b> depth_tools.cpp:79</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_ac077b9fe4972ac558c4506193d9f117b"><div class="ttname"><a href="structDepthTools_1_1Camera.html#ac077b9fe4972ac558c4506193d9f117b">DepthTools::Camera::backprojectX</a></div><div class="ttdeci">int backprojectX(float x, float depth, float factor=1000.f) const </div><div class="ttdoc">Given the depth by depth/factor, back project the x coordinate to image plain. </div><div class="ttdef"><b>Definition:</b> depth_tools.cpp:71</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_adab192877142048d2ef887cb2a7f2e51"><div class="ttname"><a href="structDepthTools_1_1Camera.html#adab192877142048d2ef887cb2a7f2e51">DepthTools::Camera::principal_y</a></div><div class="ttdeci">float principal_y</div><div class="ttdoc">Principal point y coordinate. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:100</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_a34b8f5bf9592942336b758dba2a975d5"><div class="ttname"><a href="structDepthTools_1_1Camera.html#a34b8f5bf9592942336b758dba2a975d5">DepthTools::Camera::projectZ</a></div><div class="ttdeci">float projectZ(unsigned short depth, float factor=1000.f) const </div><div class="ttdoc">Get the z coordinate of the projected point given the depth as depth/factor. </div><div class="ttdef"><b>Definition:</b> depth_tools.cpp:39</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_ac16b93a85e37c55024ef394eaf75391f"><div class="ttname"><a href="structDepthTools_1_1Camera.html#ac16b93a85e37c55024ef394eaf75391f">DepthTools::Camera::cropping_x</a></div><div class="ttdeci">float cropping_x</div><div class="ttdoc">If the image was cropped in x dimension by a specific number of pixels. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:94</div></div>
<div class="ttc" id="classDepthTools_html"><div class="ttname"><a href="classDepthTools.html">DepthTools</a></div><div class="ttdoc">Tools for using depth information. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:40</div></div>
<div class="ttc" id="classDepthTools_html_a4e6d9dd6e6befb91222f7e2b1b5a58fa"><div class="ttname"><a href="classDepthTools.html#a4e6d9dd6e6befb91222f7e2b1b5a58fa">DepthTools::computeCloudFromDepth</a></div><div class="ttdeci">static void computeCloudFromDepth(const cv::Mat &amp;depth, const Camera &amp;camera, cv::Mat &amp;cloud)</div><div class="ttdoc">Compute a point cloud stored as three channel float image from the given depth map and the intrinsic ...</div><div class="ttdef"><b>Definition:</b> depth_tools.cpp:87</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_af5126a2aac351482c1545e014f33baf6"><div class="ttname"><a href="structDepthTools_1_1Camera.html#af5126a2aac351482c1545e014f33baf6">DepthTools::Camera::projectY</a></div><div class="ttdeci">float projectY(T y, unsigned short depth, float factor=1000.f) const </div><div class="ttdoc">Given the depth by depth/factor, project the y coordinate into 3D room. </div><div class="ttdef"><b>Definition:</b> depth_tools.cpp:60</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html"><div class="ttname"><a href="structDepthTools_1_1Camera.html">DepthTools::Camera</a></div><div class="ttdoc">Represents basic intrinsic parameters used to project pixels into a point cloud. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:45</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_adde5a323c881acc956535dffe0a491a7"><div class="ttname"><a href="structDepthTools_1_1Camera.html#adde5a323c881acc956535dffe0a491a7">DepthTools::Camera::focal_y</a></div><div class="ttdeci">float focal_y</div><div class="ttdoc">Focal length in y. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:104</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_a071885bfabfbfd5fa95108d6426c2d8e"><div class="ttname"><a href="structDepthTools_1_1Camera.html#a071885bfabfbfd5fa95108d6426c2d8e">DepthTools::Camera::focal_x</a></div><div class="ttdeci">float focal_x</div><div class="ttdoc">Focal length in x. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:102</div></div>
<div class="ttc" id="structDepthTools_1_1Camera_html_ae92153e30078cf854dcc1fb18295a59e"><div class="ttname"><a href="structDepthTools_1_1Camera.html#ae92153e30078cf854dcc1fb18295a59e">DepthTools::Camera::principal_x</a></div><div class="ttdeci">float principal_x</div><div class="ttdoc">Principal point x coordinate. </div><div class="ttdef"><b>Definition:</b> depth_tools.h:98</div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Sun Apr 16 2017 16:39:17 for Superpixel Benchmark by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
